function retrieveRating(utorId, userId, profId) {
	var utorId = utorId;
	var userId = userId;
	var profId = profId;
	
	//Presentation
	var pres_val = 0;
	var pres = document.getElementsByName("pres");
	
	for(var i=0; i < pres.length; i++) {
		if(pres[i].checked){
	      pres_val = pres[i].value;
		}
	}
	
	//Communication
	var comm_val = 0;
	var comm = document.getElementsByName("comm");
	
	for(var i=0; i < comm.length; i++) {
		if(comm[i].checked){
			comm_val = comm[i].value;
		}
	}
	
	//Explanation
	var exp_val = 0;
	var exp = document.getElementsByName("exp");
	
	for(var i=0; i < exp.length; i++) {
		if(exp[i].checked){
			exp_val = exp[i].value;
		}
	}
	
	//Teaching
	var teach_val = 0;
	var teach = document.getElementsByName("teach");
	
	for(var i=0; i < teach.length; i++) {
		if(teach[i].checked){
			teach_val = teach[i].value;
		}
	}
	
	//Workload
	var work_val = 0;
	var work = document.getElementsByName("work");
	
	for(var i=0; i < work.length; i++) {
		if(work[i].checked){
			work_val = work[i].value;
		}
	}
	
	//Difficulty
	var diff_val = 0;
	var diff = document.getElementsByName("diff");
	
	for(var i=0; i < diff.length; i++) {
		if(diff[i].checked){
			diff_val = diff[i].value;
		}
	}
	
	//Learning Experience
	var learn_val = 0;
	var learn = document.getElementsByName("learn");
	
	for(var i=0; i < learn.length; i++) {
		if(learn[i].checked){
			learn_val = learn[i].value;
		}
	}
	
	var param = "utorId=" + utorId + "&userId=" + userId + "&profId=" + profId + "&pres=" + pres_val + "&comm=" + comm_val + 
	"&exp=" + exp_val + "&teach=" + teach_val + "&work=" + work_val + "&diff=" + diff_val + "&learn=" + learn_val;
	
	return param;
};


function submitRating(utorId, userId, profId) {	
	var param = retrieveRating(utorId, userId, profId);
	
	var url = "proceedRating";
	var ajax1 = new ajaxCall(param,url,function(status, text, xml) {
		if (status == 200) {
			var msg = xml.getElementsByTagName("message")[0].childNodes[0].nodeValue;
			document.getElementById('status').innerHTML = msg;
		}
	});
};